package com.feimt.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.feimt.mapper.ShoppingCartMapper;
import com.feimt.pojo.ShoppingCart;
import com.feimt.service.ShoppingCartService;
import com.feimt.utils.BaseContent;
import org.springframework.stereotype.Service;

/**
 * @author 宋孟林
 * @description
 */
@Service
public class ShoppingCartServiceImpl extends ServiceImpl<ShoppingCartMapper, ShoppingCart> implements ShoppingCartService {
    @Override
    public void clean() {
        LambdaQueryWrapper<ShoppingCart> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(ShoppingCart::getUserId, BaseContent.getThreadLocal());
        this.remove(wrapper);
    }
}
